#!python
from binary_helpers import *

""" switch.py
Create a simple binary file whith a switch node
switch.xml and this file must ALWAYS be in sync
"""

FILE = "switch.bin"
MODEL = "switch.xml"
VALUES = [3, 2, 3.14159, 7890, bstr("hello world", 32), 0, 123, 1, 122]

def main():
    """
    """
    fd = open(FILE, mode='wb') 

    #3 switch statements in an array
    int_to_bin(fd, 3)
    
    #case 2
    int_to_bin(fd, 2)
    float_to_bin(fd, 3.14159)
    int_to_bin(fd, 7890)
    string_to_bin(fd, "hello world", 32)
    
    #case 0
    int_to_bin(fd, 0)
    int_to_bin(fd, 123)
    
    #case 1
    int_to_bin(fd, 1)
    byte_to_bin(fd, 122)
    
    fd.close()

if __name__ == "__main__":
    main()
